/*******************************************************************************
** CopyRight (c) 2005-2008 SKY-MOBI Ltd. All rights reserved.
** Filename:  .h
** Creator:   yuzhifeng
** Version:   0.0
** Date:      
** Description:
*******************************************************************************/

#ifndef __ACCOUNT_TOPWND_H__
#define __ACCOUNT_TOPWND_H__

#include "stdarg.h"
#include "sgl_window.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */



/**
 * \brief top window id start
 */
#define ACCOUNT_TOPWND_ID_START		MPS_TOPWIN_ACCOUNT_BASE


#define RECHARGE_CARDTYPE_PHONE	1
#define RECHARGE_CARDTYPE_OTHER	2	
#define RECHARGE_WND_PHONE		0xFFFE
//#define RECHARGE_WND_OTHER		0xFFFF
/**
 * \brief Recharge top-level window id
 */
enum {
	ACCOUNT_TOPWND_USERCENTER = ACCOUNT_TOPWND_ID_START,
	ACCOUNT_TOPWND_USERMANAGER,
	// login
	LOGIN_TOPWND_LOGIN ,
	LOGIN_TOPWND_REGIST,
	LOGIN_TOPWND_MODIFYPWD,
	LOGIN_TOPWND_MODIFYUSERNAME,
	LOGIN_TOPWND_SETSECRETQ,
	LOGIN_TOPWND_GETSECRETQ,
	LOGIN_TOPWND_RESETPWDBYSECRETQ,
	LOGIN_TOPWND_RESETPWDBYSMS,
	LOGIN_TOPWND_SELECTRESETPWD,
	LOGIN_TOPWND_SHOWPAGE,
	LOGIN_TOPWND_SHOWREGISTPAGE,
	LOGIN_TOPWND_SHOWUSERINFO,
	LOGIN_TOPWND_MODIFYUSERINFO,

	
	LOGIN_TOPWND_RECORD,
	LOGIN_TOPWND_MSGBOX,


	// charge
	RECHARGE_TOPWND_MAIN,
	RECHARGE_TOPWND_CARD,
	RECHARGE_TOPWND_SUBMIT,
	RECHARGE_TOPWND_SMS,
	RECHARGE_TOPWND_EXCHANGE,
	RECHARGE_TOPWND_INFO,
	RECHARGE_TOPWND_WAITING,
	RECHARGE_TOPWND_FAILED,
	RECHARGE_TOPWND_CONFIRM,
	RECHARGE_TOPWND_MSGBOX,
	RECHARGE_TOPWND_ReceiveSynChannel,

	RECHARGE_TOPWND_OTHERCARD_LIST,
	RECHARGE_TOPWND_OTHERCARD_WND,

	//query
	RECHARGE_QUERYWND_MAIN,
	RECHARGE_QUERYWND_ITEM,
	RECHARGE_QUERYWND_SELECT,
	RECHARGE_QUERYWND_BALANCE,

	// payment

    // mail
	MAIL_TOPWND_LIST,
	MAIL_TOPWND_CONTENT,
	
	ACCOUNT_MAX_TOPWND_COUNT
};


/**
 * \brief Recharge user defined events
 */
enum {
	RECHARGE_WM_ONGETRECHARGECONFIG = WM_USER,
//	RECHARGE_WM_ONRECHARGEBYCARD,
//	RECHARGE_WM_ONRECHARGEBYCARD_ERROR,
//	RECHARGE_WM_ONRECHARGEBYSMS,
	RECHARGE_WM_ONRECHARGEBYSMS_ERROR,
	RECHARGE_WM_ONGETBALANCE
};


typedef  struct {
	HWND hWnd;
	SGL_WndProc wndProcId;
} topWnd_t;


/**
 * \brief get the top window
 *
 * \param wid the top window id
 * \return 
 */
HWND Account_GetTopWindow(WID wid);

/**
 * \brief show a top window
 *
 * \param wid the top window id
 * \param listener the top window listener
 * \param userdata the user specific data
 * \return the top window handle, NULL when failed
 */
HWND Account_ShowTopWindow(WID wid, HWND listener, DWORD userdata);

/**
 * \brief hide a top window
 *
 * \param wid the top window id
 * \param destroy if destory the window
 * \param redraw if refresh the top window
 */
VOID Account_HideTopWindow(WID wid, BOOL destroy, BOOL redraw);

void ShowUserInfo(void);

void Show_ModifyUserInfo_Wnd(void);

void TryGetUserInfo(VOID);

PWSTR PacketWStr(PWSTR out, PCWSTR str,...);
int32 ul2wstr(PWSTR out, uint32 value);
#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif

